package com.member.common.enums;

import lombok.Getter;

import java.util.Objects;

/*
*
* 是否会员(0:非会员,1:会员)
* */
@Getter
public enum StandingEnum {
    UN_MEMBER(0, "非会员"),
    IS_MEMBER( 1, "会员"),
    ;

    private final Integer key;
    private final String desc;

    StandingEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public static StandingEnum getByKey(Integer _key){
        for (StandingEnum item : StandingEnum.values()){
            if(Objects.equals(item.getKey(), _key)){
                return item;
            }
        }
        return null;
    }

}
